home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
nivb
/
prntserv.frm
< prev
next >
Wrap
Text File
|
1995-05-07
|
3KB
|
92 lines
VERSION 2.00
Begin Form PrintServerForm
Caption = "Print Server Services Test"
ClientHeight = 2715
ClientLeft = 1455
ClientTop = 1545
ClientWidth = 5265
Height = 3120
Left = 1395
LinkTopic = "Form1"
ScaleHeight = 2715
ScaleWidth = 5265
Top = 1200
Width = 5385
Begin CommandButton CancelButton
Caption = "&Cancel"
Height = 375
Left = 2880
TabIndex = 2
Top = 2160
Width = 855
End
Begin CommandButton OKButton
Caption = "&OK"
Default = -1 'True
Height = 375
Left = 1680
TabIndex = 1
Top = 2160
Width = 855
End
Begin ListBox PrintServerList
Height = 1590
Left = 720
TabIndex = 0
Top = 480
Width = 4215
End
Begin Label Label1
Caption = "Select a print server:"
Height = 255
Left = 240
TabIndex = 3
Top = 120
Width = 2175
End
End
Const CR = 13
Sub CancelButton_Click ()
Unload PrintServerForm
End Sub
Sub Form_Load ()
Dim objectType As String * 6
PrintServerList.Clear
oID& = -1 'initialize object ID to -1 for first call to ScanBinderyObject
Do
oName$ = String$(48, 0)
ccode% = ScanBinderyObject("*", OT_PRINT_SERVER, oID&, oName$, oType%, oHasProps%, oFlag%, oSecurity%)
If (ccode% = SUCCESSFUL) Then
'take all characters of server name up to terminating null
out$ = Left$(oName$, InStr(oName$, Chr$(0)) - 1)
PrintServerList.AddItem out$
End If
Loop Until ccode%
If (PrintServerList.ListCount > 0) Then PrintServerList.ListIndex = 0
End Sub
Sub OKButton_Click ()
PrintServerName$ = PrintServerList.List(PrintServerList.ListIndex)
If (Len(PrintServerName$) > 0) Then
PSInfoForm.Show
Else
MsgBox "No print servers available.", MB_OK, "Error"
Unload PrintServerForm
End If
End Sub
Sub PrintServerList_Click ()
PrintServerName$ = PrintServerList.List(PrintServerList.ListIndex)
End Sub
Sub PrintServerList_DblClick ()
OKButton_Click
End Sub